From: Cosimo Cecchi Date: Wed, 7 Jan 2015 09:53:30 +0000 (+0800) Subject: search: don't forget to notify caller when failing to ensure actors X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~1916 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=cea946e745e0c143572f737042a44e0ca173b002;p=gnome-shell.git search: don't forget to notify caller when failing to ensure actors The updateSearch() function is called in SearchResults every time new search hits are available from a search provider; SearchResults will wait for updateSearch() to complete in a callaback, to update the overall progress of the search operation. updateSearch() will call _ensureResultActors(), which will in turn call getResultMetas() on the search provider, which is an operation that can fail arbitrarily or return inconsistent data, as it's entirely in the hands of the search provider. In case _ensureResultActors() returns a failure, updateSearch() is currently failing to notify the passed-in callback, which might leave SearchResults in an inconsistent state: make sure the asynchronous flow always ends up with a notification to the updateSearch() callback. --- diff --git a/js/ui/search.js b/js/ui/search.js index 2a8e0fd8e..d80fe6388 100644 --- a/js/ui/search.js +++ b/js/ui/search.js @@ -236,6 +236,7 @@ const SearchResultsBase = new Lang.Class({ this._ensureResultActors(results, Lang.bind(this, function(successful) { if (!successful) { this._clearResultDisplay(); + callback(); return; }